using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace PeDALS.Tools.AZ.PSTArchive.PSTData
{
    public class PSTPageTrailer
    {
        private PageTypes mptType;
        private PageTypes mptTypeRepeat;
        private UInt16 m16PageSignature;
        private UInt32 m32CRC;
        private UInt64 m64BIDraw;

        public PSTPageTrailer(BinaryReader brReader, bool blnUnicode)
        {
            mptType = (PageTypes) brReader.ReadByte();
            mptTypeRepeat = (PageTypes) brReader.ReadByte();
            m16PageSignature = brReader.ReadUInt16();
            if (blnUnicode) m32CRC = brReader.ReadUInt32();
            m64BIDraw = blnUnicode ? brReader.ReadUInt64() : Convert.ToUInt64(brReader.ReadUInt32());
            if (!blnUnicode) m32CRC = brReader.ReadUInt32();
        }

        public PageTypes ptType
        {
            get
            {
                return mptType;
            }
        }

        public PageTypes ptTypeRepeat
        {
            get
            {
                return mptTypeRepeat;
            }
        }

        public UInt16 PageSignature
        {
            get
            {
                return m16PageSignature;
            }
        }

        public UInt32 CRC
        {
            get
            {
                return m32CRC;
            }
        }

        public UInt64 BIDraw
        {
            get
            {
                return m64BIDraw;
            }
        }
    }
}
